package com.yisoo.ubag.iot.component;


import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class IAcsClientComponent {
    @Value("${mqtt.user.accessKeyID}")
    private  String accessKey;

    @Value("${mqtt.user.accessKeySecret}")
    private  String accessSecret;

    @Value("${mqtt.iot.regionId}")
    private  String regionId;

    @Bean
    public IAcsClient getIAcsClient(){
        DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKey, accessSecret);
        return new DefaultAcsClient(profile);
    }

}
